<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('转正评分表新增及修改')" />
	<th:block th:include="include :: businessCSS" />
	<style type="text/css">
		.layui-table[lay-size="sm"] td input{text-align:center}
		.layui-table[lay-size="sm"] .layui-form-radio{margin:20px 0px}
	</style>
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
	    <div class="north">
            <th:block th:include="include :: business_btn" />
	        <th:block th:include="include :: business_tpl('top')" />
			<!-- 静态表格 -->
		    <div style="margin:10px">
			  	<table class="layui-table" lay-size="sm">
			    <colgroup>
			      <col width="10%">
			      <col width="10%">
			      <col width="60%">
			      <col width="10%">
			      <col width="10%">
			    </colgroup>
				<thead>
			      <tr>
			        <th rowspan="2">考评项目</th>
			        <th rowspan="2">考评内容</th>
			        <th rowspan="2">说明</th>
			        <th colspan="2">直接上级考评</th>
			      </tr>
			      <tr>
			        <th><p>优秀10分，良好8-9分</p><p>一般6-7分，较差1-5分</p></th>
			        <th>评估结果</th>
			      </tr>
			    </thead>
			    <tbody>
		    	  <tr>
			        <td class="table-title" rowspan="2">日常行为</td>
			        <td class="table-title">自律意识</td>
			        <td class="table-title text_l">良好的纪律性，严格遵守公司各项规章制度，并能影响他人</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fZlYs" name="fZlYs" autocomplete="off" class="layui-input"></td>
			        <td rowspan="11" class="text_c" style="min-width:120px">
			        	<p><input type="radio" name="vPgJg" value="提前转正" title="提前转正"></p>
			        	<p><input type="radio" name="vPgJg" value="如期转正" title="如期转正"></p>
			        	<p><input type="radio" name="vPgJg" value="延长试用" title="延长试用"></p>
			        	<p><input type="radio" name="vPgJg" value="终止试用" title="终止试用"></p>
		        	</td>
			      </tr>
		    	  <tr>
			        <td class="table-title">情绪管理</td>
			        <td class="table-title text_l">拥有稳定的情绪和成熟的心态，能自我减压</td>
			        <td><input type="number" min="0" max="10" id="fQxGl" name="fQxGl" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title" rowspan="3">工作态度</td>
			        <td class="table-title">责任意识</td>
			        <td class="table-title text_l">勇于承担，为成功完成工作而保持高度热情，并愿意付出额外努力</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fZrYs" name="fZrYs" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">服务意识</td>
			        <td class="table-title text_l">较强的亲和力，换位思考，帮助伙伴，竭尽全力解决问题</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fFwYs" name="fFwYs" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">积极主动</td>
			        <td class="table-title text_l">积极面对工作困难，主动思考解决方案</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fJjZd" name="fJjZd" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title" rowspan="5">工作能力</td>
			        <td class="table-title">专业技能</td>
			        <td class="table-title text_l">充分具备本岗位所需的专业知识、技能，能胜任岗位工作</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fZyJn" name="fZyJn" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">执行力</td>
			        <td class="table-title text_l">自动自发，保质保量完成工作任务</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fZxL" name="fZxL" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">学习能力</td>
			        <td class="table-title text_l">强烈的学习意识，有明确的学习计划（与本职工作相关）</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fXxNl" name="fXxNl" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">沟通协调</td>
			        <td class="table-title text_l">主动沟通与跟进已成为工作习惯，擅长聆听，有效沟通</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fGtXt" name="fGtXt" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">创新能力</td>
			        <td class="table-title text_l">反应敏捷，思路开阔，善于总结归纳，敢于挑战惯例，有新概念，新方法</td>
			        <td><input type="number" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' min="0" max="10" id="fCxNl" name="fCxNl" autocomplete="off" class="layui-input"></td>
			      </tr>
			      <tr>
			      	<td class="table-title" colspan="3">合计得分</td>
			        <td class="canntEdit"><input type="text" id="fHjDf" name="fHjDf" autocomplete="off" class="canntEdit" readonly/></td>
			      </tr>
			      <tr>
			      	<td colspan="5" class="table-title">考评说明：《员工转正评估表》总分100分，本表应在新员工转正前7日内实施考评，考评得分≥85分可申请提前转正，≥75分可如期转正，&lt;75分需延长试用期或终止试用</td>
			      </tr>
			      </tbody>
			  </table>
		  	</div>
    	</div>
	   	<th:block th:include="include :: pageFooter" /> 
        </form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: businessTableBtn" />
<th:block th:include="include :: inlineJS" />
<script type="text/javascript">
var $,layer,form,laydate,element;//定义layui模块
var nid = $("#nid").val(),noTable;//定义全局参数
layui.use(['laydate','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,laydate = layui.laydate,util = layui.util,element=layui.element;
 	beforeInit();//表单初始化之前的动作集合
 	layui.element.render();
 	$.get("/hr/scoreforprobation/listbynid?nid="+nid,function(res){
 		noTable=res.data;
	});
 	$.each(t_fields,function(v,k){//初始赋值
 		if(k.fields=="vPgJg"){
 			if(k.fieldContent)$("input[name="+k.fields+"][value="+k.fieldContent+"]").attr("checked",true);
 			if(gridColumns.readOnly)$("input[name="+k.fields+"]").attr('disabled','disabled');
 		}else $('#'+k.fields).val(k.fieldContent);
 	})
 	if(gridColumns.readOnly){//流程结束后静态表格变为不可编辑
 	 	$('table input').attr('readonly','readonly');
		$('table .canntEdit').removeClass('canntEdit');
 	}
 	form.render();
})
$("table input").blur(function(obj){//监听表格内输入框，计算总评分
	var sum_score=0;
	$.each($('table .layui-input'),function(v,k){
		sum_score+=Number(k.value);
	})
	$('#fHjDf').val(sum_score);
})

function beforeSave(tableData){//如果评估结果为空则不进行报错
	if($('[name="vPgJg"]:checked').val())return tableData;
	else return "评估结果不能为空";
}
</script>
</body>
</html>